#! /usr/bin/python
import random
import sys

letters = []
letters_number = []

for i in range(65,91):
    letters.append(chr(i))
    letters_number.append(i)

for i in range(97,123):
    letters.append(chr(i))
    letters_number.append(i)

dict_letter = dict(zip(letters_number,letters))

special_characters = [",",".","<",">","\\","=","^","$","(",")","{","}","[","]","&",";","/","~","%","*","|","-","+","\"","`","•","√","π","÷","×","¶","∆","£","¢"," ","€","¥","°","©","®","™","✓","!","?","'",":",";"]
characters_numbers = []

for i in special_characters:
    number = ord(i)
    characters_numbers.append(number)

list_numbers = ["0","1","2","3","4","5","6","7","8","9"]

dictionary = dict(zip(characters_numbers ,special_characters))
dictionary.update(dict_letter)

def password(long):
    passwd = ""
    for i in range(long):
        random_num = random.randint(48,130)
        char0 = chr(random_num)
        passwd += char0
    return passwd

def cls():
    import os
    if os.name == "nt":
        os.system("cls")
    else:
        os.system("clear")

if __name__ == "__main__":
    try:
         arg = sys.argv[1]
         password0 = password(int(arg))
         print(password0)
         sys.exit()
    except:
        pass
    cls()
    print("Strong password generator/强密码生成器")
    print("WRITTEN BY SYSTEM-RAMOS-NZY/作者：SYSTEM-RAMOS-NEY")
    print("Follow me on Bilibili!/在Bilibili上关注我！\n")
    try:
         length = int(input("Enter password length/输入密码长度:"))
    except:
        print("Password length must be an integer./密码长度必须为整数。\n")
        sys.exit()
    password0 = password(length)
    print("Your strong password is/你的强密码是:")
    print(password0+"\n")
    print("Tips: Passwords that contain uppercase and lowercase letters, spaces, and special symbols, and that are longer than 12 digits help keep your data safe.")
    print("小贴士：包含大小写字母，空格和特殊符号，且长度大于12位的密码有助于保护您的数据安全。\n")
    sys.exit()


